/*
package com.tqz.web.flux.demo.servlet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.AsyncContext;
import javax.servlet.ServletResponse;
import java.io.IOException;

*/
/**
 * <p>
 *
 * @author tianqingzhao
 * @since 2023/3/4 17:52
 *//*

public class AsyncWrapper implements Runnable {

    private static final Logger log = LoggerFactory.getLogger(AsyncWrapper.class);

    private AsyncContext asyncContext;

    private ServletResponse response;

    private Thread thread;

    public AsyncWrapper(AsyncContext asyncContext, ServletResponse response, Thread thread) {
        this.asyncContext = asyncContext;
        this.response = response;
        this.thread = thread;
    }

    @Override
    public void run() {
        process(asyncContext, response, thread);
    }

    private void process(AsyncContext asyncContext, ServletResponse response, Thread thread) {
        try {
            Thread.sleep(5000);
            log.info("当前处理线程：{}", Thread.currentThread().getName());
            response.getWriter().println("async.");
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }

        asyncContext.complete();
    }

    public AsyncContext getAsyncContext() {
        return asyncContext;
    }

    public ServletResponse getResponse() {
        return response;
    }
}
*/
